<template>
	<view class="content">
		<view class="top-con">
			<view class="top">
				今日收入：{{todayIncome}}
			</view>
		</view>
		<view class="cu-list menu">
			<view class="cu-item" v-for="(item,index) in list" v-if="!isshow">
				<view class="content padding-tb-sm">
					<view class="title">
						{{item.remarks}}
					</view>
					<view class="text-gray text-sm">
						{{item.addTime}}
					</view>
				</view>
				<view class="action red" v-if="item.addType==1">
					+{{item.moneyNum}}
				</view>
				<view class="action green" v-if="item.addType==-1">
					-{{item.moneyNum}}
					<!-- <view class="" v-if="item.fundsType=='fundsType'">
						
					</view> -->
				</view>
			</view>
			<view class="no-content" v-if="isshow">
				<image src="../../../static/images/no_order.png" mode="" class="no-img"></image>
				<view class="no-text">暂无内容...</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {moneylist,moneygetSum} from '@/api/index.js'
	var i = 1
	export default {
		data() {
			return {
				list: [],
				todayIncome: 0,
				isshow: true
			}
		},
		onLoad() {
			moneylist({type: 2}).then(res=>{
				console.log(res)
				if(res.length==0) {
					this.isshow = true
				}else {
					this.list = res
					this.isshow = false
				}
			})
			moneygetSum({type: 1}).then(res=>{
				console.log(res.todayIncome)
				if(res.todayIncome===null) {
					this.todayIncome = 0
				}else {
					this.todayIncome = res.todayIncome
				}
			})
		},
		onReachBottom() {
			i++
			moneylist({
				pageNumber: i,
				pageSize: 10,
				type: 2
				}).then(res=>{
				console.log(res)
				for(var a=0;a<res.length;a++) {
					this.list.push(res[a])
				}
			})
		}
	}
</script>

<style lang="scss">
	.top-con{height:80rpx;background: #fff;line-height: 80rpx;font-size: 24rpx;color: #999999;justify-content: center;}
	.top{padding:0 24rpx;}
	.cu-list{margin-top:20rpx}
	.title{color: #3E3E3E;font-size: 28rpx;}
	.red{color: #FF203B;}
	.green{color: #03B76A;}
	.no-content {
		text-align: center;
		.no-img {
			width: 300rpx ;
		}
	}
</style>
